<?php
/**
 * 2020-10-25 重构api父类Action
 */
namespace App;
defined('IN_IA') or exit('Access Denied');
class A
{
    protected $_result = array('status'=>'error');
    protected $_gpc = array();
    protected $_uid = 0;

    protected function __construct()
    {
        global $_GPC,$_W;
        $this->_gpc = $_GPC;
        $this->_uid = isset($this->_gpc["uid"]) ? $this->_gpc["uid"] :
            KUYUAN_DEBUG ? 1 : $_W["member"]["uid"];
    }

    /**
     * 接口返回内容处理
     * @param $_data
     */
    protected function result($_data)
    {
        if (is_array($_data)) {
            echo json_encode($_data);
        } else {
            echo $_data;
        }
        exit;
    }
}